package com.ml.mall.service.order;

import com.ml.mall.bean.page.Page;
import com.ml.mall.bean.req.BaseBeanReq;
import com.ml.mall.bean.req.order.OrderEditReq;
import com.ml.mall.bean.req.order.OrderNewReq;
import com.ml.mall.bean.req.order.OrderPaymentDataQueryDto;
import com.ml.mall.bean.req.order.OrderQueryPageReq;
import com.ml.mall.bean.req.vo.OrderMailTemplateVO;
import com.ml.mall.bean.res.order.OrderQueryOneRes;
import com.ml.mall.bean.res.order.OrderQueryPageRes;
import com.ml.mall.entity.company.SysCompany;
import com.ml.mall.entity.order.SysOrder;
import com.baomidou.mybatisplus.extension.service.IService;

import java.security.NoSuchAlgorithmException;
import java.util.Map;

/**
* <p>
    *  服务类
    * </p>
*
* @author kyyang
* Created 2021-05-24
*/
public interface SysOrderService extends IService<SysOrder> {

    /**
     * @description: 订单创建
     * @author kyyang
     * @date 2021/5/24 21:25
     * @version 1.0
     * @return
     */
    Map<String, String> sysOrderNew(OrderNewReq orderNewReq) throws NoSuchAlgorithmException;

    /**
     * @description: 订单修改
     * @author kyyang
     * @date 2021/5/24 21:53
     * @version 1.0
     */
    //买家订单状态不支持修改；暂时放着
    int sysOrderEdit(OrderEditReq orderEditReq);

    /**
     * @description: 分页返回订单信息
     * @author kyyang
     * @date 2021/5/29 15:37
     * @version 1.0
     */
    Page<OrderQueryPageRes> sysOrderByPage(OrderQueryPageReq req);

    /**
     * @description: 查询买家订单详情
     * @author kyyang
     * @date 2021/5/29 16:23
     * @version 1.0
     */
    OrderQueryOneRes sysOrderBuyerQuery_one(BaseBeanReq req);

    /**
     * @description: 根据订单号查询订单
     * @author kyyang
     * @date 2021/5/29 22:29
     * @version 1.0
     */
    SysOrder selectOrderByOid(Long oid);


    OrderMailTemplateVO orderMailTemplateVO(SysOrder sysOrder);

    /**
     * 根据订单数据获取订单支付数据
     * @param dto
     * @return
     */
    Map<String, String> orderPaymentDataQuery(OrderPaymentDataQueryDto dto) throws NoSuchAlgorithmException;

    /**
     * 查询订单买家
     * @param oid
     * @return
     */
    SysCompany orderCompanyQuery(Long oid);
}
